<style>
    .twoDiv {
        padding: 10px 0px;
        border-bottom: 1px solid #f6f6f6;
        color: #333;
        height: 160px;
    }

    .three {
        height: 500px;
        padding: 10px 0px;
    }
</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">运单列表</div>

                        <div class="layui-card-body">
                            <div class="twoDiv ">
                                <form class="layui-form layui-form-pane" method="post" action="">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo grid-demo-bg1">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">托运单号：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="checkenumber" id="checkenumber"
                                                               lay-verify="title"
                                                               autocomplete="off" placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo">
                                                <div class="layui-inline">
                                                    <label class="layui-form-label">托运日期：</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="checkedate" id="checkedate"
                                                               lay-verify="date1"
                                                               placeholder="yyyy-MM-dd" autocomplete="off"
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo grid-demo-bg1">
                                                <div class="layui-inline">
                                                    <label class="layui-form-label">承诺日期：</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="promisedate" id="promisedate"
                                                               lay-verify="date1"
                                                               placeholder="yyyy-MM-dd" autocomplete="off"
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">出发地：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="departure" lay-verify="title"
                                                               autocomplete="off"
                                                               placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo grid-demo-bg1">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">到达分站：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <select name="arrivesubstations" id="arrivesubstations"
                                                                lay-search="">
                                                            <option value=""></option>
                                                        </select>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">到达城市：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="arrivecity" lay-verify="title"
                                                               autocomplete="off"
                                                               placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo grid-demo-bg1">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">发货单位：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="shippingunits" lay-verify="title"
                                                               autocomplete="off"
                                                               placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">收货单位：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="receivingunit" lay-verify="title"
                                                               autocomplete="off"
                                                               placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo grid-demo-bg1">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">货物名称：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="goodsname" lay-verify="title"
                                                               autocomplete="off"
                                                               placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs3">
                                            <div class="grid-demo">

                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">运输单号：</label>
                                                    <div class="layui-input-block" style="width:180px;">
                                                        <input type="text" name="transportnumber" lay-verify="title"
                                                               autocomplete="off"
                                                               placeholder="请输入" class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs6" style="margin-top:10px">
                                            <div class="grid-demo">
                                                <div class="layui-form-item">
                                                    <div class="layui-inline">
                                                        <div class="layui-input-block " style="margin-left: 0px;">
                                                            <input type="checkbox" name="yundanstate" value="未装载"
                                                                   title="未装载">
                                                            <input type="checkbox" name="yundanstate" value="已装车"
                                                                   title="已装车">
                                                            <input type="checkbox" name="yundanstate" value="到站库存"
                                                                   title="到站库存">
                                                            <input type="checkbox" name="yundanstate" value="派送中"
                                                                   title="派送中">
                                                            <input type="checkbox" name="yundanstate" value="已签收"
                                                                   title="已签收">
                                                            <button class="layui-btn layui-btn-normal layui-btn-sm" lay-submit
                                                                    lay-filter="formDemo">运单搜索
                                                            </button>
                                                        </div>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                    <!--<div class="layui-row">
                                        <div class="layui-col-xs12" style="height:30px">
                                            <div class="grid-demo">
                                                <div class="layui-form-item">
                                                    <button class="layui-btn layui-btn-normal layui-btn-sm" lay-submit
                                                            lay-filter="formDemo">运单搜索
                                                    </button>
                                                    <button type="button" id="delwaybill"
                                                            class="layui-btn layui-btn-normal layui-btn-sm">运单作废
                                                    </button>
                                                    <button type="button" id="updatewaybill"
                                                            class="layui-btn layui-btn-normal layui-btn-sm">修改运单
                                                    </button>
                                                    <button type="button" id="outsource"
                                                            class="layui-btn layui-btn-normal layui-btn-sm">其它外包登记
                                                    </button>
                                                    <button type="button" id="newtracking" class="layui-btn layui-btn-normal layui-btn-sm">
                                                        新增跟踪
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>-->
                                </form>
                            </div>
                            <div class="three">
                                <table class="layui-hide" id="waybilllist" lay-filter="waybilllist"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--菜单工具栏-->
<script type="text/html" id="toolbar">
    <div class="grid-demo">
        <div class="layui-form-item">
            <button type="button" id="delwaybill"
                    class="layui-btn layui-btn-normal layui-btn-sm">运单作废
            </button>
            <button type="button" id="updatewaybill"
                    class="layui-btn layui-btn-normal layui-btn-sm">修改运单
            </button>
            <button type="button" id="outsource"
                    class="layui-btn layui-btn-normal layui-btn-sm">其它外包登记
            </button>
            <button type="button" id="newtracking" class="layui-btn layui-btn-normal layui-btn-sm">
                新增跟踪
            </button>
        </div>
    </div>
</script>
<script>
    layui.use(['table', 'form', 'jquery', 'layer', 'tree', 'util'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , table = layui.table;
        var $ = layui.jquery;

        form.render();

        /*分站下拉框赋值*/
        $.ajax({
            url: "../../../../querysubseries",
            success: function (data) {
                for (var i = 0; i < data.length; i++) {
                    $("#arrivesubstations").append("<option value='" + data[i].subName + "'>" + data[i].subName + "</option>");
                    //重新渲染
                    form.render("select");
                }
            }
        });


        var tableIns = table.render({
            elem: '#waybilllist'
            , url: '../../../../queryinformation'
            , title: '用户数据表'
            , toolbar: '#toolbar'
            , height: 500
            , limit: 8
            , limits: [8, 16, 24, 32]
            , cols: [[
                {type: 'checkbox'}
                , {field: 'checkenumber', title: '托运单号', width: 150, sort: true}
                , {field: 'checkedate', title: '托运日期', width: 150}
                , {field: 'ordersnumber', title: '订单编号', width: 150}
                , {field: 'departure', title: '出发地', width: 150}
                , {field: 'arrivesubstations', title: '到达分站', width: 150}
                , {field: 'arrivecity', title: '到达城市', width: 150}
                , {field: 'transporttype', title: '运输类型', width: 150}
                , {field: 'deliverymethod', title: '送货方式', width: 150}
                , {field: 'yundanstate', title: '运单状态', width: 150}
                , {field: 'promisedate', title: '承诺日期', width: 150}
                , {field: 'goodsnumber', title: '货物单号', width: 150}
                , {field: 'goodsname', title: '货物名称', width: 150}
                , {field: 'goodsquantity', title: '数量', width: 150}
                , {field: 'wrapmanner', title: '包装方式', width: 150}
                , {field: 'goodsweight', title: '重量(单)/KG', width: 150}
                , {field: 'goodsvolume', title: '体积（单）/m3', width: 150}
                , {field: 'goodsunitprice', title: '单价', width: 150}
                , {field: 'billingmanner', title: '计费方式', width: 150}
                , {field: 'basicfreight', title: '基本运费', width: 150}
                , {field: 'pickupfee', title: '提货费', width: 150}
                , {field: 'deliveryfees', title: '送货费', width: 150}
                , {field: 'goodsvalue', title: '货物价值', width: 150}
                , {field: 'goodsinsured', title: '保价费用', width: 150}
                , {field: 'unloadingfees', title: '卸货费', width: 150}
                , {field: 'otherfees', title: '其它费用', width: 150}
                , {field: 'costcombined', title: '费用合', width: 150}
                , {field: 'payasyougo', title: '现付', width: 150}
                , {field: 'paymentmethod', title: '付款方式', width: 150}
                , {field: 'paydelivery', title: '到付', width: 150}
                , {field: 'goodsremarks', title: '货物备注', width: 150}
                , {field: 'consigners', title: '发货人', width: 150}
                , {field: 'shippingphone', title: '发货电话', width: 150}
                , {field: 'shippersbackupphone', title: '备用电话', width: 170}
                , {field: 'shippingunits', title: '发货单位', width: 150}
                , {field: 'shippingaddress', title: '发货地址', width: 150}
                , {field: 'consignees', title: '收货人', width: 150}
                , {field: 'receivingphone', title: '收货电话', width: 150}
                , {field: 'consigneesbackupphone', title: '备用电话', width: 150}
                , {field: 'receivingunit', title: '收货单位', width: 150}
                , {field: 'receiptaddress', title: '收货地址', width: 150}
                , {field: 'transportnumber', title: '运输单号', width: 150}
                , {field: 'transportcarnumber', title: '运输车号', width: 150}
                , {field: 'drivername', title: '司机姓名', width: 150}
                , {field: 'driverphone', title: '司机电话', width: 150}
                , {field: 'departuretime', title: '发车时间', width: 150}
                , {field: 'storagesite', title: '入库站点', width: 150}
                , {field: 'outsourcingnumber', title: '外包单号', width: 150}
                , {field: 'outsourcingcompany', title: '外包公司', width: 150}
                , {field: 'outsourcephone', title: '外包电话', width: 150}
                , {field: 'subcontractingdate', title: '转包日期', width: 150}
                , {field: 'outsourcedfreight', title: '外包运费', width: 150}
                , {field: 'outsourcingtype', title: '外包类型', width: 150}
                , {field: 'deliverytime', title: '派送时间', width: 150}
                , {field: 'operateyuan', title: '操作员', width: 150}
            ]]
            , page: true
        });

        /*其它外包按钮监听点击事件*/
        $("#outsource").on("click", function () {
            var table = layui.table;
            var checkStatus = table.checkStatus('waybilllist');
            var ids = "";
            var outsour = "";
            for (var i = 0; i < checkStatus.data.length; i++) {
                ids += checkStatus.data[i].checkenumber;
                outsour += checkStatus.data[i].outsourcingnumber
                if (i != checkStatus.data.length - 1) {
                    ids += ",";
                    outsour += ",";
                }
                if (outsour == "null") {
                    outsourceaddDate(ids);
                } else {
                    alert("已存在外包信息,详情请去外包管理查看")
                }
            }
        });


        /*新增跟踪按钮监听点击事件*/
        $("#newtracking").on("click", function () {
            var table = layui.table;
            var checkStatus = table.checkStatus('waybilllist');
            var ids = "";
            for (var i = 0; i < checkStatus.data.length; i++) {
                ids += checkStatus.data[i].checkenumber;
                if (i != checkStatus.data.length - 1) {
                    ids += ",";
                }
            }
            traceaddDate(ids);
        });

        /*删除按钮监听点击事件*/
        $("#delwaybill").on("click", function () {
            var table = layui.table;
            var checkStatus = table.checkStatus('waybilllist');
            var ids = "";
            for (var i = 0; i < checkStatus.data.length; i++) {
                ids += checkStatus.data[i].checkenumber;
                if (i != checkStatus.data.length - 1) {
                    ids += ",";
                }
            }
            waybillDelectDate(ids);
        });

        /*修改按钮监听点击*/
        $("#updatewaybill").on("click", function () {
            var table = layui.table;
            var checkStatus = table.checkStatus('waybilllist');
            var ids = "";
            for (var i = 0; i < checkStatus.data.length; i++) {
                ids += checkStatus.data[i].checkenumber;
                if (i != checkStatus.data.length - 1) {
                    ids += ",";
                }
            }
            waybillUpdateDate(ids);
        });

        /*表单提交*/
        form.on('submit(formDemo)', function (data) {
            tableIns.reload({
                type: 'post'
                , url: '../../conditionDeparturelist',
                where: {
                    //设定异步数据接口的额外参数，任意设
                    checkenumber: data.field.checkenumber
                    , checkedate: data.field.checkedate
                    , promisedate: data.field.promisedate
                    , departure: data.field.departure
                    , arrivesubstations: data.field.arrivesubstations
                    , arrivecity: data.field.arrivecity
                    , shippingunits: data.field.shippingunits
                    , receivingunit: data.field.receivingunit
                    , transportnumber: data.field.transportnumber
                    , goodsname: data.field.goodsname
                    , yundanstate: data.field.yundanstate
                }
                , page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
            return false;
        });

        /*监听行单击事件（双击事件为：rowDouble）*/
        table.on('rowDouble(waybilllist)', function (obj) {
            var data = obj.data;
            $.ajax({
                url: '../../getDeparturelistByid',
                method: 'post',
                data: {
                    checkenumber: data.checkenumber
                },
                dataType: "json",
                success: function (data) {
                    //弹出层waybilldetailpopup
                    waybilldetailpopup();
                    setTimeout(function () {
                        //jquery获取内嵌框架对象
                        var sorder = $("#sorder").contents();
                        sorder.find("#checkenumber").val(data.checkenumber);
                        sorder.find("#checkedate").val(data.checkedate);
                        sorder.find("#yundanstate").val(data.yundanstate);
                        sorder.find("#departure").val(data.departure);
                        sorder.find("#arrivesubstations").val(data.arrivesubstations);
                        sorder.find("#arrivecity").val(data.arrivecity);
                        sorder.find("#shippingunits").val(data.shippingunits);
                        sorder.find("#consigners").val(data.consigners);
                        sorder.find("#shippingaddress").val(data.shippingaddress);
                        sorder.find("#shippingphone").val(data.shippingphone);
                        sorder.find("#receivingunit").val(data.receivingunit);
                        sorder.find("#consignees").val(data.consignees);
                        sorder.find("#receiptaddress").val(data.receiptaddress);
                        sorder.find("#receivingphone").val(data.receivingphone);
                        sorder.find("#deliverymethod").val(data.deliverymethod);
                        sorder.find("#transporttype").val(data.transporttype);
                        sorder.find("#promisedate").val(data.promisedate);
                        sorder.find("#ordersnumber").val(data.ordersnumber);
                        sorder.find("#goodsname").val(data.goodsname);
                        sorder.find("#goodsquantity").val(data.goodsquantity);
                        sorder.find("#wrapmanner").val(data.wrapmanner);
                        sorder.find("#goodsweight").val(data.goodsweight);
                        sorder.find("#goodsvolume").val(data.goodsvolume);
                        sorder.find("#goodsunitprice").val(data.goodsunitprice);
                        sorder.find("#billingmanner").val(data.billingmanner);
                        sorder.find("#basicfreight").val(data.basicfreight);
                        sorder.find("#pickupfee").val(data.pickupfee);
                        sorder.find("#deliveryfees").val(data.deliveryfees);
                        sorder.find("#goodsvalue").val(data.goodsvalue);
                        sorder.find("#goodsinsured").val(data.goodsinsured);
                        sorder.find("#unloadingfees").val(data.unloadingfees);
                        sorder.find("#otherfees").val(data.otherfees);
                        sorder.find("#costcombined").val(data.costcombined);
                        sorder.find("#payasyougo").val(data.payasyougo);
                        sorder.find("#paymentmethod").val(data.paymentmethod);
                        sorder.find("#paydelivery").val(data.paydelivery);
                        sorder.find("#goodsremarks").val(data.goodsremarks);
                        sorder.find("#operateyuan").val(data.operateyuan);
                        sorder.find("#transportnumber").val(data.transportnumber);
                        sorder.find("#drivername").val(data.drivername);
                        sorder.find("#driverphone").val(data.driverphone);
                        sorder.find("#departuretime").val(data.departuretime);
                        sorder.find("#storagesite").val(data.storagesite);
                        sorder.find("#outsourcingnumber").val(data.outsourcingnumber);
                        sorder.find("#outsourcingcompany").val(data.outsourcingcompany);
                        sorder.find("#outsourcephone").val(data.outsourcephone);
                        sorder.find("#subcontractingdate").val(data.subcontractingdate);
                        sorder.find("#outsourcedfreight").val(data.outsourcedfreight);
                        sorder.find("#outsourcingtype").val(data.outsourcingtype);
                    }, 500);
                }
            });
        });
        /*删除运单信息*/

        //ids 运单id
        function waybillDelectDate(ids) {
            layui.use(['layer', 'table', 'jquery'], function () {
                var layer = layui.layer;
                var table = layui.table;
                var $ = layui.jquery;
                layer.open({
                    content: '测试回调',
                    //大小
                    area: ['300px', '180px'],
                    btn: ['确定', '取消'],
                    content: '确定要提交作废?',
                    yes: function (index, kskks) {
                        $.ajax({
                            url: '../../delectDeparturelist',
                            type: 'post',
                            dataType: 'text',
                            data: {
                                waybillnumber: ids
                            },
                            success: function (data) {
                                //表刷新方法
                                alert(data);
                                reloads();
                            }
                        });
                        layer.close(index);
                    }

                });
            });
        }

        /*增加外包信息并弹出层赋值*/
        function outsourceaddDate(ids) {
            layui.use(['table', 'jquery', 'form'], function () {
                var form = layui.form;
                var table = layui.table;
                var $ = layui.jquery;
                $.ajax({
                    url: '../../getDeparturelistByid',
                    method: 'post',
                    data: {
                        checkenumber: ids
                    },
                    dataType: "json",
                    success: function (data) {
                        outsourcingpopup();
                        setTimeout(function () {
                            //jquery获取内嵌框架对象
                            var encased = $("#encased").contents();
                            encased.find("#checkenumber").val(data.checkenumber);
                            encased.find("#goodsnumber").val(data.goodsnumber);
                            encased.find("#operateyuan").val(data.operateyuan);
                        }, 500);
                    }
                });
            });
        }

        /*增加新的跟踪信息并弹出层赋值*/
        function traceaddDate(ids) {
            layui.use(['table', 'jquery', 'form'], function () {
                var form = layui.form;
                var table = layui.table;
                var $ = layui.jquery;
                $.ajax({
                    url: '../../getTailafter',
                    method: 'post',
                    data: {
                        waybillnumber: ids
                    },
                    dataType: "json",
                    success: function (data) {
                        detailspopup();
                        setTimeout(function () {
                            //jquery获取内嵌框架对象
                            var details = $("#details").contents();
                            details.find("#consignmentid").val(data.Tailafter.waybillId);
                            details.find("#tailafter").val(data.Tailafter.tailafter);
                            details.find("#tailafterTime").val(data.Tailafter.tailafterTime);
                            details.find("#state").val(data.Tailafter.state);
                        }, 500);
                    }
                });
            });
        }

        /*修改运单信息并弹出层修改层赋值*/

        //ids: 运单信息id
        function waybillUpdateDate(ids) {
            layui.use(['table', 'jquery', 'form'], function () {
                var form = layui.form;
                var table = layui.table;
                var $ = layui.jquery;
                $.ajax({
                    url: '../../getDeparturelistByid',
                    method: 'post',
                    data: {
                        checkenumber: ids
                    },
                    dataType: "json",
                    success: function (data) {
                        //弹出层waybillupdatepopup
                        waybillupdatepopup();
                        setTimeout(function () {
                            //jquery获取内嵌框架对象
                            var waybill = $("#waybill").contents();
                            index.find("#checkenumber").val(data.checkenumber);
                            index.find("#checkedate").val(data.checkedate);
                            index.find("#yundanstate").val(data.yundanstate);
                            index.find("#departure").val(data.departure);
                            index.find("#arrivesubstations").val(data.arrivesubstations);
                            index.find("#arrivecity").val(data.arrivecity);
                            index.find("#shippingunits").val(data.shippingunits);
                            index.find("#consigners").val(data.consigners);
                            index.find("#shippingaddress").val(data.shippingaddress);
                            index.find("#shippingphone").val(data.shippingphone);
                            index.find("#receivingunit").val(data.receivingunit);
                            index.find("#consignees").val(data.consignees);
                            index.find("#receiptaddress").val(data.receiptaddress);
                            index.find("#receivingphone").val(data.receivingphone);
                            index.find("#deliverymethod").val(data.deliverymethod);
                            index.find("#transporttype").val(data.transporttype);
                            index.find("#promisedate").val(data.promisedate);
                            index.find("#ordersnumber").val(data.ordersnumber);
                            index.find("#goodsname").val(data.goodsname);
                            index.find("#goodsquantity").val(data.goodsquantity);
                            index.find("#wrapmanner").val(data.wrapmanner);
                            index.find("#goodsweight").val(data.goodsweight);
                            index.find("#goodsvolume").val(data.goodsvolume);
                            index.find("#goodsunitprice").val(data.goodsunitprice);
                            index.find("#billingmanner").val(data.billingmanner);
                            index.find("#basicfreight").val(data.basicfreight);
                            index.find("#pickupfee").val(data.pickupfee);
                            index.find("#deliveryfees").val(data.deliveryfees);
                            index.find("#goodsvalue").val(data.goodsvalue);
                            index.find("#goodsinsured").val(data.goodsinsured);
                            index.find("#unloadingfees").val(data.unloadingfees);
                            index.find("#otherfees").val(data.otherfees);
                            index.find("#costcombined").val(data.costcombined);
                            index.find("#payasyougo").val(data.payasyougo);
                            index.find("#paymentmethod").val(data.paymentmethod);
                            index.find("#paydelivery").val(data.paydelivery);
                            index.find("#goodsremarks").val(data.goodsremarks);
                            index.find("#operateyuan").val(data.operateyuan);
                            index.find("#transportnumber").val(data.transportnumber);
                            index.find("#drivername").val(data.drivername);
                            index.find("#driverphone").val(data.driverphone);
                            index.find("#departuretime").val(data.departuretime);
                            index.find("#storagesite").val(data.storagesite);
                            index.find("#outsourcingnumber").val(data.outsourcingnumber);
                            index.find("#outsourcingcompany").val(data.outsourcingcompany);
                            index.find("#outsourcephone").val(data.outsourcephone);
                            index.find("#subcontractingdate").val(data.subcontractingdate);
                            index.find("#outsourcedfreight").val(data.outsourcedfreight);
                            index.find("#outsourcingtype").val(data.outsourcingtype);
                        }, 500);
                    }
                });
            });
        }


        /*弹出层修改运单*/
        function waybillupdatepopup() {
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    skin: 'layui-layer-molv',//皮肤
                    content: '测试回调',
                    //大小
                    area: ['90%', '650px'],
                    btn: [],
                    content: '<iframe src="/src/views/waybillManagement/iframe/waybillupdate.html" id="waybill" width="100%" height="100%" frameborder="0"/>',
                    closeBtn: 2, //关闭按钮样式默认1
                    anim: 4 //设置关闭动画
                });
            });
        }

        /*弹出层运单详情*/
        function waybilldetailpopup() {
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    skin: 'layui-layer-molv',//皮肤
                    content: '测试回调',
                    //大小
                    area: ['90%', '650px'],
                    btn: [],
                    content: '<iframe src="/src/views/waybillManagement/iframe/detailsorder.html" id="sorder" width="100%" height="100%" frameborder="0"/>',
                    closeBtn: 2, //关闭按钮样式默认1
                    anim: 4 //设置关闭动画
                });
            });
        }

        /*弹出层新增跟踪*/
        function detailspopup() {
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    skin: 'layui-layer-molv',//皮肤
                    content: '测试回调',
                    //大小
                    area: ['70%', '550px'],
                    btn: [],
                    content: '<iframe src="/src/views/waybillManagement/iframe/trackzd.html" id="details" width="100%" height="100%" frameborder="0"/>',
                    closeBtn: 2, //关闭按钮样式默认1
                    anim: 4 //设置关闭动画
                });
            });
        }

        /*弹出层新增其它外包*/
        function outsourcingpopup() {
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    skin: 'layui-layer-molv',//皮肤
                    content: '测试回调',
                    //大小
                    area: ['90%', '650px'],
                    btn: [],
                    content: '<iframe src="/src/views/waybillManagement/iframe/outsourcingzd.html" id="encased" width="100%" height="100%" frameborder="0"/>',
                    closeBtn: 2, //关闭按钮样式默认1
                    anim: 4 //设置关闭动画
                });
            });
        }

        /* 表刷新方法 */
        function reloads() {
            layui.use('layer', function () {
                var table = layui.table;
                table.reload("waybilllist");
            });
        }
    });
</script>


